//-------------------------------------------------------------------
//	Copyright (c) 2010-2012 Zhirnov Andrey
//	This file is part of the "UXGEN" project.
//	See copyright notice in "Engine.h".
//-------------------------------------------------------------------

#ifndef _UX_PROGRAM_DATA_OBJECT_H
#define _UX_PROGRAM_DATA_OBJECT_H

#include "../CResource.h"

namespace Engine
{
namespace Resources
{

	//
	// Program Data Object interface
	//

	class _EXPORT_ IProgramDataObject : protected CReferenced, public CEngBaseObject
	{
	private:
		virtual void _Release()	{ Release(); }

	public:
		IProgramDataObject(): CEngBaseObject() {}
		~IProgramDataObject() {}

		virtual bool CopyData(const IProgramDataObjectPtr &pObj) = 0;
		virtual bool GetData(TProgramData &sData, uint uIndex = 0) const = 0;
		virtual bool SetData(const TProgramData &sData, uint uIndex = 0) = 0;
		virtual uint GetDataIndex(e_program_data::type eType, usize uDataSize) const = 0;

		virtual e_prog_data_obj::type	GetType() const		{ return e_prog_data_obj::UNKNOWN; }

		/*
			GetData() & SetData() :
				uIndex - index for inner data, if index not used then ignored,
						 return false if index are incorrect.

			GetDataIndex() - return -1 if not suitable data, else return index of inner data,
							if index not used then return 0.	
		*/
	};



	//
	// Program Data Object Event Listener
	//

	class _EXPORT_ IPDOEventListener : protected CReferenced, public CEngBaseObject
	{
	private:
		virtual void _Release()	{ Release(); }

	public:
		virtual void OnBind() = 0;	// while program binded
	};

//-------------------------------------------------------------------

}	// Resources
}	// Engine

#endif	// _UX_PROGRAM_DATA_OBJECT_H